package com.nfdw.project.web;

import com.nfdw.project.core.Result;
import com.nfdw.project.core.ResultGenerator;
import com.nfdw.project.dto.SaleUsersProfitAndLoseInfoDto;
import com.nfdw.project.service.SaleUsersProfitAndLoseTotalInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 交易售电企业盈亏情况controller
 */
@RestController
@RequestMapping("/api/sale/users/profit/and/lose/info")
public class SaleUsersProfitAndLoseInfoController {

    @Autowired
    private SaleUsersProfitAndLoseTotalInfoService saleUsersProfitAndLoseTotalInfoService;


    /**
     * 售电公司盈亏情况
     * @return
     */
    @PostMapping("/trade/settle/info")
    public Result tradeSettleInfo(SaleUsersProfitAndLoseInfoDto param){
        return ResultGenerator.genSuccessResult(saleUsersProfitAndLoseTotalInfoService.tradeSettleInfo(param));
    }

    /**
     * 代理用电和平均度电收益和平均度电收益情况
     * @return
     */
    @PostMapping("/trade/power/and/income")
    public Result tradePowerAndIncome(SaleUsersProfitAndLoseInfoDto param){
        return ResultGenerator.genSuccessResult(saleUsersProfitAndLoseTotalInfoService.tradePowerAndIncome(param));
    }

    /**
     * 盈利和亏损情况
     * @return
     */
    @PostMapping("/trade/profit/and/loss")
    public Result tradeProfitAndLoss(SaleUsersProfitAndLoseInfoDto param){
        return ResultGenerator.genSuccessResult(saleUsersProfitAndLoseTotalInfoService.tradeProfitAndLoss(param));
    }



}
